Skip to content

Support proxy and onion #392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 2, 2025

Conversation

eval-exec
Copy link
Collaborator

@eval-exec eval-exec commented Dec 18, 2024

This PR introduces and supports Onion3 multiaddr for tentacle-multiaddr and adds socks5 proxy support for tentacle dialing. It also allows tentacle to connect to a Tor server to reach an onion address.

A breaking change introduced is:

  1. Changing

    pub(crate) type TcpSocketConfig =
        Arc<dyn Fn(TcpSocket) -> Result<TcpSocket, std::io::Error> + Send + Sync + 'static>;

    to:

    pub(crate) type TcpSocketTransformer =
        Arc<dyn Fn(TcpSocket) -> Result<TcpSocket, std::io::Error> + Send + Sync + 'static>;
    
    pub(crate) struct TcpSocketConfig {
        pub(crate) socket_transformer: TcpSocketTransformer,
        pub(crate) proxy_config: Option<ProxyConfig>,
    }
  2. Adding an Onion variant to the TransportType enum and implementing OnionTransport.

  3. Allow runtime::connect to use a socks5 proxy for connecting to the target address.

  4. Add runtime::connect_onion to connect to a target address of the Multiaddr type, rather than just a SocketAddr, since tentacle cannot convert an onion address into a SocketAddr.

@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 3 times, most recently from 0b06264 to 36312c5 Compare December 18, 2024 08:05
@eval-exec eval-exec marked this pull request as ready for review December 18, 2024 08:10
@eval-exec eval-exec requested a review from driftluo as a code owner December 18, 2024 08:10
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 8 times, most recently from d41cd7a to 0312d4b Compare December 19, 2024 05:54
@eval-exec eval-exec marked this pull request as draft December 19, 2024 05:55
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 4 times, most recently from 6b1f15f to f620bfe Compare December 23, 2024 08:13
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 2 times, most recently from 73e178c to a341d27 Compare February 20, 2025 04:58
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 2 times, most recently from 0bd891a to f338466 Compare March 4, 2025 08:34
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 7 times, most recently from 8a2fcf4 to 35f76e1 Compare March 13, 2025 04:18
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 2 times, most recently from d2ea5ab to a7897c6 Compare March 25, 2025 06:04
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch from a7897c6 to c102430 Compare March 25, 2025 06:15
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch from c102430 to c2a7bf9 Compare March 25, 2025 06:17
@eval-exec eval-exec marked this pull request as draft March 31, 2025 06:09
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 2 times, most recently from 5cebc18 to c284918 Compare March 31, 2025 13:32
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 9 times, most recently from d299251 to 921aae0 Compare April 2, 2025 03:27
@eval-exec eval-exec marked this pull request as ready for review April 2, 2025 03:31
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch 2 times, most recently from 083ace8 to 6161481 Compare April 2, 2025 04:35
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch from 6161481 to 194183d Compare April 2, 2025 04:47
Signed-off-by: Eval EXEC <execvy@gmail.com>
@eval-exec eval-exec force-pushed the exec/proxy-and-onion branch from 194183d to c13c964 Compare April 2, 2025 05:06
@driftluo driftluo merged commit 71f8833 into nervosnetwork:master Apr 2, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Kanban Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants